home *** CD-ROM | disk | FTP | other *** search
/ Visual FX for Image FX / VisualFX for Image FX 3.adf / Files / ARexx / 03 / 07.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1997-07-31  |  3.1 KB  |  176 lines

  1. /*
  2.                           Visual FX Arexx Script
  3.                            Written By J.L. White
  4.                          (C)1997 Merlin's Software
  5. */
  6.  
  7. Options Results
  8. address "IMAGEFX.1"
  9. ScreenToFront
  10. Undo Off
  11. if exists("libs:flyer.library") then do
  12.     TOASTERLIB="ToasterARexx.port"
  13.     call remlib('ToasterARexx.port')
  14.     call remlib('PROJECT_REXX_PORT')
  15.     call addlib('PROJECT_REXX_PORT' , 0)
  16.     call addlib(TOASTERLIB,0)
  17.     end
  18. call Settings()
  19. call open TempFile,"VFXIFX:TempDrawer/"FXNum".txt",R
  20. line = readln(TempFile)
  21. PicAName = strip(line)
  22. line = readln(TempFile)
  23. Start = strip(line)
  24. line = readln(TempFile)
  25. End = strip(line)
  26. line = readln(TempFile)
  27. IAType = strip(line)
  28. line = readln(TempFile)
  29. Template = strip(line)
  30. line = readln(TempFile)
  31. WindowType = strip(line)
  32. line = readln(TempFile)
  33. CropAnswer = strip(line)
  34. call close TempFile
  35.  
  36. Frames = (End - Start)+1
  37. j=0
  38. k=0
  39. TFrames = Frames
  40. TNum = 3
  41. if TFrames > 999 then TNum = 4
  42. if TFrames > 9999 then TNum = 5
  43. if Field = 1 then TFrames = Frames*2
  44. do i = Start to End
  45.     k = k+ 1
  46.     call open TempFile,"RAM:VFXNums",W
  47.     call writeln TempFile,right(k,5,'0')
  48.     call writeln TempFile,right(Frames,5,'0')
  49.     call close TempFile
  50.     f=0
  51.     Redraw Off
  52.     j = j+ 1
  53.     FieldSet = 0
  54.     call DoIt()
  55.     Redraw On
  56.     call SaveIt()
  57.         if Field = 1 then do
  58.             Redraw Off
  59.             j = j + 1
  60.             FieldSet = 1
  61.             call DoIt()
  62.             Redraw On
  63.             call SaveIt()
  64.             end 
  65.     end
  66.     Undo On
  67. exit
  68.  
  69.  
  70.  
  71. LoadA:
  72.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  73.         Undo On
  74.         exit
  75.         end
  76.     if IAType = 0 then do
  77.         LoadBuffer PicAName Force i
  78.         if Field = 1 then do
  79.             GetMain
  80.             parse var result Name Width Height Blah
  81.             if FieldSet = 0 then do
  82.                 Hook DeInterlace
  83.                 Scale Width Height
  84.                 end
  85.             if FieldSet = 1 then do
  86.                 Hook DeInterlace
  87.                 Swap
  88.                 Scale Width Height
  89.                 end
  90.             end
  91.         end
  92.     if IAType = 1 then do
  93.         LoadBuffer PicAName Force 1
  94.         end
  95.     if IAType = 2 then do
  96.         LoadBuffer PicAName Force
  97.         end
  98.     if IAType = 3 then do
  99.         LoadBuffer PicAName""right(i,TNum,'0') Force
  100.         end
  101. return
  102.  
  103.  
  104. SaveIt:
  105.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  106.         Undo On
  107.         exit
  108.         end
  109.     if SaveType = 0 then do
  110.         call Switcher(TOSW)
  111.         call Switcher(MDV1)
  112.  
  113.         Render Go
  114.         if Field = 1 then
  115.                 call RecordAdd(SaveName,1,6,Compression)
  116.         else
  117.                 call RecordAdd(SaveName,2,6,Compression)
  118.         if j = TFrames then
  119.             call MakeIcon(SaveName,(Frames-10))
  120.         end
  121.  
  122.     if SaveType = 1 then do
  123.         if Field = 1 then do
  124.             f= f + 1
  125.             if f = 1 then
  126.                 SaveBufferAs ILBM "VFXIFX:TempDrawer/PicA"
  127.             if f = 2 then do
  128.                 GetMain
  129.                 parse var result Name Width Height Blah
  130.                 Scale Width Height/2
  131.                 Swap
  132.                 LoadBuffer "VFXIFX:TempDrawer/PicA" Force
  133.                 Scale Width Height/2
  134.                 Hook Interlace
  135.                 SaveBufferAs ILBM SaveName""right(k,TNum,'0')
  136.                 f = 0
  137.                 end
  138.             end
  139.         else do
  140.             SaveBufferAs ILBM SaveName""right(k,TNum,'0')
  141.             end    
  142.         end
  143.  
  144. return
  145.  
  146.  
  147. DoIt:
  148.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  149.         Undo On
  150.         exit
  151.         end
  152.  
  153.     call LoadA()
  154.     GetMain
  155.     parse var result Name Width Height Blah
  156.     if CropAnswer ~= "None" then do
  157.         CropAnswer
  158.         Scale Width Height
  159.         end
  160.     Swap
  161.     LoadBuffer Template Force
  162.     Scale Width Height
  163.     Swap
  164.  
  165.     Scissors
  166.     Region Brush
  167.     Box 0 0 Width Height
  168.     Swap
  169.     FillMode Warp 0 0 0 Smooth
  170.     FilledBox WindowType
  171.     Buffer2Swap
  172.     KillBrush
  173. return
  174.  
  175.  
  176.